#!/bin/bash

VER=*
APP_NAME=client-0.0.1-SNAPSHOT
PORT=8089
APP_JAR="/home/data/wwwroot/api/"$APP_NAME".jar"

PID=$(lsof -i :$PORT|grep -v "PID"|awk '{print $2}')
if [ -z "$PID" ]
then
    echo $APP_JAR closed
else
    echo $APP_JAR closing
    kill -9 $PID
	sleep 5s
fi

echo start...
nohup java -jar $APP_JAR --spring.profiles.active=dev >/dev/null 2>&1 &
echo sucess
exit
